﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/RedesignedMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<final_darskade.Models.klass>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    klassEdit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        ویرایش کلاس ها</h2>
    <!--% using (Html.BeginForm())
       {%-->
    <form id="form1" method = "post" action = "klassEdit" runat="server">
    <!--%: Html.ValidationSummary(true) %-->
        <fieldset>
            <legend>Fields</legend>
            <div class="editor-label">
                شماره‌ی کلاس
            </div>
            <div class="editor-field">
                <input type="text" name="kid" disabled="disabled" value="<%=Model.id%>" />
                <input type = "hidden" name="id"  value="<%=Model.id%>" />
            </div>
            <div class="editor-label">
                نام درس
            </div>
            <div class="editor-field">
                <select name="course_id">
                    <% foreach (final_darskade.Models.course c in (List<final_darskade.Models.course>)ViewData["courseName"])
                       { %>
                            <%if (Model.course_id == c.course_id)
                              { %>
                                    <option value="<%=c.course_id%>" selected="selected"><%=c.name%></option>
                            <%}
                              else
                              { %>
                                    <option value="<%=c.course_id%>" ><%=c.name%></option>
                            <%} %>
                    <% } %>
                </select>
            </div>
            <div class="editor-label">
                نام استاد
            </div>
            <div class="editor-field">
                <select name="prof_id">
                    <% foreach (final_darskade.Models.user u in (List<final_darskade.Models.user>)ViewData["professorName"])
                       { %>
                            <% if (Model.prof_id == u.user_id)
                               { %>
                                <option value="<%=u.user_id%>" selected="selected"> <%=u.first_name + " " + u.last_name%> </option>
                            <% }
                               else
                               {%>
                                <option value="<%=u.user_id%>"> <%=u.first_name + " " + u.last_name%> </option>
                            <% }%>
                    <% } %>
                </select>
            </div>
            <div class="editor-label">
                زمان کلاس
            </div>
            <div class="editor-field">
                <select name="time_id">
                    <% foreach (final_darskade.Models.time_in_week t in (List<final_darskade.Models.time_in_week>)ViewData["timeid"])
                       {%>
                        <%if (Model.time_id == t.id)
                          { %>
                                <option value="<%=t.id%>" selected="selected"> <%= t.id%> </option>
                        <%}
                          else
                          {%>
                                <option value="<%=t.id%>"> <%= t.id%> </option>
                        <%} %>
                    <% } %>
                </select>
            </div>
            <div class="editor-label">
                ترم
            </div>
            <div class="editor-field">
                <input type="text" name="term" value="<%=Model.term%>"/>
            </div>
            <div class="editor-label">
                زمان شروع امتحان
            </div>
            <div class="editor-field">
                <input type="text" name="start_exam_date_time" value="<%=Model.start_exam_date_time%>" />
            </div>
            <div class="editor-label">
                زمان پایان امتحان
            </div>
            <div class="editor-field">
                <input type="text" name="end_exam_date_time" value="<%=Model.end_exam_date_time%>"/>
            </div>
            <p>
                <input type="submit" value="ثبت" />
            </p>
        </fieldset>
    <!--% } %-->
    </form>
    <div>
        <%: Html.ActionLink("Back to List", "klassShow") %>
    </div>
</asp:Content>
